<?php
class points {
	
	private $place ;
	private $nbPoints ;
	
	
	public function __construct()
	{
		$this->db = new myPdo ;
		$req="set names 'UTF8'";
		$this->db->exec($req);
	}
	
	public function setPlace($place) 
	{
		$this->place = $place ;
	}
	public function setNbPoints($nbPoints) 
	{
		$this->nbPoints = $nbPoints ;
	}
	
	public function getPlace() 
	{
		return $this->place;
	}
	public function getNbPoints() 
	{
		return $this->nbPoints;
	}
	
	public function pointsGagnes()
	{
		$r = "SELECT PTNBPOINTSPLACE FROM points WHERE PTPLACE =".$this->place." ; " ;
		$resu = $this->db->query($r) ;
		$ligne = $resu->fetch(PDO::FETCH_OBJ) ;
		$this->nbPoints = $ligne->PTNBPOINTSPLACE ;
	}
}